package com.qf.service.impl;

import com.qf.dao.RecommendDao;
import com.qf.pojo.Recommend;
import com.qf.pojo.resp.BaseResult;
import com.qf.service.RecommendService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RecommendServiceImpl implements RecommendService {

    @Resource
    RecommendDao recommendDao;

    @Override
    public BaseResult findRecommend() {
       List<Recommend> recommendList= recommendDao.findAllRecommend();
        BaseResult baseResult = new BaseResult();
        if(recommendList!=null){
            baseResult.setCode(1);
            baseResult.setData(recommendList);
        }else{
            baseResult.setCode(0);
        }
        return baseResult;
    }
}
